
import 'package:dio/dio.dart';

import 'HttpUtil.dart';

Future getHttp(String url, {Map<String, dynamic>? params}) async {
  Response response = await HttpUtil.of().dio.get(url, queryParameters: params,options: Options(responseType: ResponseType.json));
  return response;
}

Future postHttp(String url, {dynamic body,Map<String, dynamic>? params}) async {
  Response response = await HttpUtil.of().dio.post(url,data: body ,queryParameters: params,options: Options(responseType: ResponseType.json));
  return response.data;
}

Future download(String url,String filePath, {dynamic body,Map<String, dynamic>? params}) async {
  Response response = await HttpUtil.of().dio.download(url,filePath,data: body ,queryParameters: params,options: Options(responseType: ResponseType.json));
  return response;
}
